package com.xhwl.centiotdata.pojo.enums.talk;

/**
 * @description:
 * @author: wuyuhao
 * @createDate: 2023/1/4 9:08
 */
public enum ModeEnum {

    ANSWERED(0, "已接听"),
    NOT_ANSWERED(1, "未接听"),
    UNLOCKED (2, "开锁"),
    CALL(3, "呼叫"),
    ENDED(4, "结束");

    private Integer code;

    private String name;

    ModeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String findNameByCode(Integer code) {
        for (ModeEnum value : ModeEnum.values()) {
            if (code.equals(value.code)) {
                return value.name;
            }
        }
        return null;
    }

}
